package com.molyfun.parents.activity.common.listactivity.factory;

import android.content.Intent;

import com.molyfun.parents.activity.common.listactivity.AbstractListFactory;

import static com.molyfun.parents.activity.classroom.ClassRoomActivity.FLAG_CLASS_IS_TEAM;
import static com.molyfun.parents.activity.common.listactivity.ListActivity.ACTIVITY_TYPE;

/**
 * Created by william(liuchao.hit@gmail.com).
 * Date:10/28/16.
 */
public class ListActivityFactory {

    public static final String FLAG_CLASS_ROOM_PLAN_ID = "classroom_plan_id";

    public static interface ActivityType {
        public static final int ACTIVITY_MSG = 1001;
        public static final int ACTIVITY_DOWNLOAD = 1002;
        //        public static final int ACTIVITY_MINE_COMMENT = 1003;
//        public static final int ACTIVITY_LIKE = 1004;
        public static final int ACTIVITY_HOMELAND = 1005;
        //        public static final int ACTIVITY_HOMELAND_HOT_LIST = 1006;
        //        public static final int ACTIVITY_CUSTOM_PLAN_PRODUCT = 1007;
        int ACTIVITY_REPORT_EVALUATE = 1008;
        int ACTIVITY_REPORT_PLAN = 1009;
        int ACTIVITY_REPORT_REPORT = 1010;
        int ACTIVITY_CLASSROOMPLAN = 1011;
        //        int ACTIVITY_CLASSROOM_COURSE = 1012;
        int ACTIVITY_CLASSROOM_VIDEO_RECORD = 1013;
    }

    public static AbstractListFactory getFactory(Intent intent) {
        switch (intent.getIntExtra(ACTIVITY_TYPE, ListActivityFactory.ActivityType.ACTIVITY_MSG)) {
            case ActivityType.ACTIVITY_DOWNLOAD:
                return new DownLoadFactory();
//            case ActivityType.ACTIVITY_MINE_COMMENT:
//                return new CommentFactory();
//            case ActivityType.ACTIVITY_LIKE:
//                return new LikeFactory();
//            case ActivityType.ACTIVITY_HOMELAND:
//                return new HomelandFactory();
//            case ActivityType.ACTIVITY_HOMELAND_HOT_LIST:
//                return new HomelandChooseHotListFactory();
            case ActivityType.ACTIVITY_REPORT_EVALUATE:
                return new EvaluateFactory();
            case ActivityType.ACTIVITY_REPORT_PLAN:
                return new PlanFactory();
            case ActivityType.ACTIVITY_REPORT_REPORT:
                return new ReportFactory();
            case ActivityType.ACTIVITY_CLASSROOMPLAN:
                return new ClassRoomPlanFactory(intent.getStringExtra(FLAG_CLASS_ROOM_PLAN_ID), intent.getBooleanExtra(FLAG_CLASS_IS_TEAM, false));
            case ActivityType.ACTIVITY_CLASSROOM_VIDEO_RECORD:
                return new ClassRoomVideoRecordFactory(intent.getStringExtra(FLAG_CLASS_ROOM_PLAN_ID));
//            case ActivityType.ACTIVITY_CLASSROOM_COURSE:
//                return new ClassRoomCourseFactory(intent.getStringExtra(FLAG_CLASS_ROOM_PLAN_ID));
            case ActivityType.ACTIVITY_MSG:
            default:
                return new MsgFactory();
        }
    }

    public static AbstractListFactory getAnnouncementFactory(String teamId) {
        return new AnnouncementFactory(teamId);
    }

    public static AbstractListFactory getReportFeedbackFactory(String trainingid) {
        return new FeedbackFactory(trainingid);
    }


    public static AbstractListFactory getTopicCommentFactory(String topicId, String userId, boolean isAnonymous) {
        return new TopicCommentFactory(topicId, userId, isAnonymous);
    }

    public static AbstractListFactory getCustomPlanProduct(String customplanid) {
        return new RecommendProductFactory(customplanid);
    }

}
